package logicclient;

import static org.junit.Assert.*;

import java.sql.SQLException;

import org.junit.Test;

import ClientDataBase.ClientDBUtils;

import stuff.Worker;


public class LoginTest {
	ClientDBUtils handler = new ClientDBUtils();
	@Test
	public void testVerifySaler(){
		Worker w = null;
		try {
			w = handler.getWorkerInfo("AB2011001");
		} catch (SQLException e) {
			e.printStackTrace();
		}
		assertEquals(1, w.getPosition());
		assertEquals("Tom", w.getName());
		assertEquals("tiancai", w.getPassword());
	}
	
	@Test
	public void testVerifySubShopManager(){
		Worker w = null;
		try {
			w = handler.getWorkerInfo("AB2011002");
		} catch (SQLException e) {
			e.printStackTrace();
		}
		assertEquals(0, w.getPosition());
		assertEquals("Henry", w.getName());
		assertEquals("tiancai", w.getPassword());
	}
}
